<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <script type="text/javascript" src="${createLinkTo(dir: 'js/jquery', file: 'jquery-1.3.2.min.js')}"></script>
  <g:render template="/entry/popupList"/>  
  <title>Edit Plan</title>
</head>
<body>
  <div id="stageList" class="popupList hidden">
    <div class="preHeader"></div>

    <div class="header"></div>
    <div class="content"></div>
    <div class="footer"><input type="button" value="关闭窗口" class="btnGrey" style="padding:3px 5px;margin:3px 0 8px 0" onClick="$('#stageList').hide()"></div>
  </div>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}">Home</a></span>
  <span class="menuButton"><g:link class="list" action="list">Plan List</g:link></span>
  <span class="menuButton"><g:link class="create" action="create">New Plan</g:link></span>
</div>
<div class="body">
  <h1>Edit Plan</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${planInstance}">
    <div class="errors">
      <g:renderErrors bean="${planInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form method="post">
    <input type="hidden" name="id" value="${planInstance?.id}"/>
    <input type="hidden" name="version" value="${planInstance?.version}"/>
    <div class="dialog">
      <table>
        <tbody>


        <tr class="prop">
          <td valign="top" class="name">
            <label for="name">Name:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'name', 'errors')}">
            <input type="text" id="name" name="name" value="${fieldValue(bean: planInstance, field: 'name')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="description">Description:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'description', 'errors')}">
            <fckeditor:editor
                name="description"
                width="100%"
                height="400"
                toolbar="Default"
                fileBrowser="default">
            ${planInstance.description}
            </fckeditor:editor> 
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="content">Content:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'content', 'errors')}">
            <textarea style="width: 80%" id="content" name="content">${planInstance.content}</textarea>
          </td>
        </tr>
        
        <tr class="prop">
          <td valign="top" class="name">
            <label for="planType">Plan Type:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'planType', 'errors')}">
            <input type="text" id="planType" name="planType" value="${fieldValue(bean: planInstance, field: 'planType')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="scheme">Scheme:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'scheme', 'errors')}">
            <input type="text" id="scheme" name="scheme" value="${fieldValue(bean: planInstance, field: 'scheme')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="startWith">Start With:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'startWith', 'errors')}">
            <input class="stagePopup" type="text" id="startWith" name="startWith" value="${fieldValue(bean: planInstance, field: 'startWith')}"/>
            <span></span>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="endWith">End With:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: planInstance, field: 'endWith', 'errors')}">
            <input class="stagePopup" type="text" id="endWith" name="endWith" value="${fieldValue(bean: planInstance, field: 'endWith')}"/>
            <span></span>
          </td>
        </tr>


        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:actionSubmit class="save" value="Update"/></span>
      <span class="button"><input type="button" name="ajaxUpdate" class="ajaxUpdate" value="Save"/></span>
      <span class="button"><input type="button" name="preview" class="preview" value="Preview"/></span>
      
      <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
